<?
/*----------------------------------------------------------------------
          (C) Bobtail-Bear 2006 	小飞熊新一代下载系统
          	代码编写：小飞熊	版权所有：小飞熊[L.F.Bear]
				官方网站/技术支持：http://www.lfbear.cn
------------------------------------------------------------------------
          (C) Bobtail-Bear 2006 	L.F.Bear's New Download Sysytem
          	Powered by L.F.Bear  Copyright L.F.Bear's Home(R)
               Official Web/Support：http://www.lfbear.cn
-----------------------------------------------------------------------*/

//本页脚本功能：软件评分、报错页面

$thispage="transact.php";
require("header.php"); 
$action=$_POST[action];
//简单的验证码过程
$num=$c_num;
$i1=rand(0,9);$i2=rand(0,9);$i3=rand(0,9);$i4=rand(0,9);
$code1=$num[$i1];$code2=$num[$i2];$code3=$num[$i3];$code4=$num[$i4];
$code=$code1.$code2.$code3.$code4;
$code_num=$i1.$i2.$i3.$i4;

switch($action)
{
case senderror:
$title=$p_lang[106];
$error_=array("1"=>$p_lang[107],"2"=>$p_lang[108],"3"=>$p_lang[109]);
$id=$_POST[id];
$errortype=$_POST[errortype];
if(empty($errortype)) $errortype=1;
$show="<form id=\"form\" name=\"form\" method=\"post\" action=\"transact.php\">
  <table width=\"580\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
    <tr>
      <td height=\"60\" align=\"left\" class=\"markedText4\">$p_lang[110] $id $p_lang[111]
        <input name=\"action\" type=\"hidden\" id=\"action\" value=\"error_save\" />
	  <input name=\"check_code\" type=\"hidden\" id=\"action\" value=\"$code_num\" />
	  <input name=\"s_id\" type=\"hidden\" id=\"s_id\" value=\"$id\" />
	  <input name=\"errortype\" type=\"hidden\" id=\"errortype\" value=\"$errortype\" /></td>
    </tr>
    <tr>
      <td height=\"60\" class=\"markedText4\">$p_lang[112]<font color=orange><b> $error_[$errortype] </b></font><br>
        <br>
        $p_lang[113]</td>
    </tr>
    <tr>
      <td height=\"60\" class=\"markedText4\">$p_lang[114]
        <input name=\"code\" type=\"text\" size=\"10\" /> 
      $p_lang[115]<font color=orange><b>$code</b></font></td>
    </tr>
    <tr>
      <td height=\"60\" align=\"center\"><input type=\"submit\" name=\"Submit\" value=\"$common[submit]\" class=\"Button2\" />&nbsp;&nbsp;
      <input type=\"button\" name=\"Submit0\" value=\"$common[return]\"  class=\"Button3\" onClick=\"gotourl('javascript:history.back(1)')\"/></td>
    </tr>
  </table>
</form>";
break;

case error_save:

$id=$_POST[s_id];
$errortype=$_POST[errortype];
$check_code=$_POST[check_code];
$code=$_POST[code];
$cook_name="error_".$id;
if($_COOKIE[$cook_name]=="ok")
{
$fb_title1=$p_lang[116];
$fb_title2=$p_lang[117];
$fb_msg=$p_lang[118];
$fb_link="view.php?id=$id";
require("feedback.php");
}
if($check_code!=$code)
{
$fb_title1=$p_lang[116];
$fb_title2=$p_lang[117];
$fb_msg=$p_lang[119];
$fb_link="view.php?id=$id";
require("feedback.php");
}
else
{
empty($_SESSION[f_name]) ? $send_name=$p_lang[120] : $send_name=$_SESSION[f_name];
if(!file_exists("include/error_report.php"))
$error_info="<? die(\"Forbidden Access!\");?>"."\n";
empty($error_info) ? $error_info=$id."|".$errortype."|".date(Ymd)."|".$send_name."\n" : $error_info.=$id."|".$errortype."|".date(Ymd)."|".$send_name."\n";

writef("include/error_report.php",$error_info,"a");

setcookie("$cook_name","ok",time()+7200);
$fb_title1=$p_lang[71];
$fb_title2=$p_lang[121];
$fb_msg=$p_lang[122];
$fb_link="view.php?id=$id";
require("feedback.php");
}


break;



case mark:
$id=$_POST[id];
$evaluate=$_POST[evaluate];
if(empty($evaluate)) $evaluate=0;
$evaluate_show=array("-1"=>$p_lang[123],"0"=>$p_lang[124],"1"=>$p_lang[125]);
$title=$p_lang[126];
$show="<form id=\"form\" name=\"form\" method=\"post\" action=\"transact.php\">
  <table width=\"580\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
    <tr>
      <td height=\"60\" align=\"left\" class=\"markedText4\">$p_lang[110] $id $p_lang[127]
	  
      <input name=\"action\" type=\"hidden\" id=\"action\" value=\"mark_save\" />
	  <input name=\"check_code\" type=\"hidden\" id=\"action\" value=\"$code_num\" />
	  <input name=\"s_id\" type=\"hidden\" id=\"s_id\" value=\"$id\" />
	  <input name=\"evaluate\" type=\"hidden\" id=\"evaluate\" value=\"$evaluate\" /></td>
    </tr>
    <tr>
      <td height=\"60\" class=\"markedText4\">$p_lang[128]<font color=orange><b> $evaluate_show[$evaluate] </b></font><br><br>$p_lang[129] $evaluate $p_lang[130]</td>
    </tr>
    <tr>
      <td height=\"60\" class=\"markedText4\">$p_lang[114]
        <input name=\"code\" type=\"text\" size=\"10\" /> 
      $p_lang[115]<font color=orange><b>$code</b></font></td>
    </tr>
    <tr>
      <td height=\"60\" align=\"center\"><input type=\"submit\" name=\"Submit\" value=\"$common[submit]\" class=\"Button2\" />&nbsp;&nbsp;
      <input type=\"button\" name=\"Submit0\" value=\"$common[return]\"  class=\"Button3\" onClick=\"gotourl('javascript:history.back(1)')\"/></td>
    </tr>
  </table>
</form>
";
break;

case mark_save:

$id=$_POST[s_id];
$evaluate=$_POST[evaluate];
$check_code=$_POST[check_code];
$code=$_POST[code];
$cook_name="mark_".$id;
if($_COOKIE[$cook_name]=="ok")
{
$fb_title1=$p_lang[116];
$fb_title2=$p_lang[117];
$fb_msg=$p_lang[131];
$fb_link="view.php?id=$id";
require("feedback.php");
}
if($check_code!=$code)
{
$fb_title1=$p_lang[116];
$fb_title2=$p_lang[117];
$fb_msg=$p_lang[119];
$fb_link="view.php?id=$id";
require("feedback.php");
}
else
{
if(file_exists($path_soft."/".$id.".mak"))
{
$mark_info=readf($path_soft."/".$id.".mak");
$mark_info=explode("|",$mark_info);
for($i=0;$i<=3;$i++)
if($mark_info[$i]=="") $mark_info[$i]=0;
$mark_info[0]+=$evaluate;
switch($evaluate)
{
case 1:
$mark_info[1]++;
break;
case 0:
$mark_info[2]++;
break;
case -1:
$mark_info[3]++;
break;
default:
break;
}
$mark_info=$mark_info[0]."|".$mark_info[1]."|".$mark_info[2]."|".$mark_info[3];
writef($path_soft."/".$id.".mak",$mark_info,"w");
}
else
{
$mark_info[0]+=$evaluate;
switch($evaluate)
{
case 1:
$mark_info[1]++;
break;
case 0:
$mark_info[2]++;
break;
case -1:
$mark_info[3]++;
break;
default:
break;
}
$mark_info=$mark_info[0]."|".$mark_info[1]."|".$mark_info[2]."|".$mark_info[3];
writef($path_soft."/".$id.".mak",$mark_info,"w");
}

setcookie("$cook_name","ok",time()+7200);
$fb_title1=$p_lang[71];
$fb_title2=$p_lang[132];
$fb_msg=$p_lang[133];
$fb_link="view.php?id=$id";
require("feedback.php");
}
break;

default:
$fb_title1=$p_lang[116];
$fb_title2=$p_lang[134];
$fb_msg=$p_lang[135];
require("feedback.php");
break;
}
?>
<body>
<table width="780" border="0" align="center" cellspacing="0">
    <td align="center" valign="top" class="tableHeader1"><br>
      <table width="580" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="32"><img src="<?=$imagepath?>/h_priont_01.gif" width="32" height="25" /></td>
          <td width="523" align="left" background="<?=$imagepath?>/header_mid.gif"><?=$title?></td>
          <td width="25" background="<?=$imagepath?>/header_mid.gif"><img src="<?=$imagepath?>/h_priont_03.gif" width="25" height="25" /></td>
        </tr>
        <tr>
          <td height="250" colspan="3" align="center" bgcolor="#FFFFFF">
		  

		  <?=$show?></td>
        </tr>
        <tr>
          <td height="25" colspan="3" bgcolor="#EFEBEF">&nbsp;</td>
        </tr>
      </table></td>
      </tr>
</table>
</body>
</html>
<? 
require("footer.php");
die(); 
?>